using System;
using System.Collections;
using System.Web.Mvc;
using Castle.Windsor;

namespace Pronghorn.Core
{
	public class CastleWindsorContainer : IIocContainer
	{
		private static readonly IWindsorContainer _container = new WindsorContainer();

	    public void AddComponent<T>(string serviceName)
		{
		    _container.AddComponent<T>(serviceName);
		}

	    public void AddComponent(string serviceName, Type interfaceType, Type implementation)
	    {
	        _container.AddComponent(serviceName,interfaceType,implementation);
	    }

	    public void Release(IController controller)
	    {
	        _container.Release(controller);
	    }

	    public T Resolve<T>(string name, Hashtable hashtable)
	    {
	        return _container.Resolve<T>(name, hashtable);
	    }

	    public T Resolve<T>()
		{
			return _container.Resolve<T>();
		}

		public T Resolve<T>(string serviceName)
		{
			return _container.Resolve<T>(serviceName);
		}
	}
}